#ifndef EFFECTS_H
#define EFFECTS_H

#include "video.h"
#include "sound.h"
#include "common.h"
#include <vector>
#include <string>

/*==============================================================================
		Base Effect class. It will be used to create all video effects
==============================================================================*/

class Effect
{
public:
	Effect(Video* video = NULL, Sound* sound = NULL);
	 ~Effect();

	// Draws effect on the screen
	virtual void Render() = 0;
	// You can write your own update function. Include SystemUpdate() then.
	virtual void Update();

	// Gives main frequency of recorded sound
	float GetSoundFreq();
	// Gives sound intensity in decibels
	float GetSoundDB();
	// Gives note octave
	int GetSoundOctave();
	// Gives pointer to sound spectrum array
	float* GetSpectrum();
	// Gives entry hz between two adjacent sound spectrum values
	float GetEntryHz();
	// Gives current time in seconds
	float GetTime();
	// Gives current note name
	std::string GetNote();

protected:
	// Updates sound, video, current time
	void SystemUpdate();

	// Pointers to created video and sound object, so we could use them
	Video* video;
	Sound* sound;

private:
	// Determines eferything about sound: 
	float sound_db;					// Sound intensity
	float sound_freq;				// Sound frequency in hertz
	int sound_freq_octave;			// Sound note octave
	float* sound_spectrum;			// Sound spectrum in array form
	float entry_hz;					// Step in sound spectrum, counted in hertz
	std::string note;				// Note name

	float time_now;					// Current time in seconds
};

#endif // EFFECTS_H
